home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / FLTK-1.0.6 / test / mandelbrot_ui.cxx < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-27  |  3.7 KB  |  127 lines

  1. // generated by Fast Light User Interface Designer (fluid) version 1.00
  2.  
  3. #include "mandelbrot_ui.h"
  4. #include <stdlib.h>
  5.  
  6. inline void Drawing_Window::cb_x_input_i(Fl_Input* o, void*) {
  7.   d->X = atof(o->value());;
  8. d->new_display();
  9. }
  10. void Drawing_Window::cb_x_input(Fl_Input* o, void* v) {
  11.   ((Drawing_Window*)(o->parent()->user_data()))->cb_x_input_i(o,v);
  12. }
  13.  
  14. inline void Drawing_Window::cb_y_input_i(Fl_Input* o, void*) {
  15.   d->Y = atof(o->value());
  16. d->new_display();
  17. }
  18. void Drawing_Window::cb_y_input(Fl_Input* o, void* v) {
  19.   ((Drawing_Window*)(o->parent()->user_data()))->cb_y_input_i(o,v);
  20. }
  21.  
  22. inline void Drawing_Window::cb_w_input_i(Fl_Input* o, void*) {
  23.   d->scale = atof(o->value());
  24. d->new_display();
  25. }
  26. void Drawing_Window::cb_w_input(Fl_Input* o, void* v) {
  27.   ((Drawing_Window*)(o->parent()->user_data()))->cb_w_input_i(o,v);
  28. }
  29.  
  30. inline void Drawing_Window::cb_brightness_i(Fl_Slider* o, void*) {
  31.   d->brightness = int(o->value());
  32. d->new_display();
  33. }
  34. void Drawing_Window::cb_brightness(Fl_Slider* o, void* v) {
  35.   ((Drawing_Window*)(o->parent()->user_data()))->cb_brightness_i(o,v);
  36. }
  37.  
  38. inline void Drawing_Window::cb_iterations_i(Fl_Slider* o, void*) {
  39.   d->iterations = 1<<int(o->value());
  40. d->new_display();
  41. }
  42. void Drawing_Window::cb_iterations(Fl_Slider* o, void* v) {
  43.   ((Drawing_Window*)(o->parent()->user_data()))->cb_iterations_i(o,v);
  44. }
  45.  
  46. void Drawing_Window::make_window() {
  47.   Fl_Window* w;
  48.   { Fl_Window* o = window = new Fl_Window(450, 520);
  49.     w = o;
  50.     o->user_data((void*)(this));
  51.     { Drawing_Area* o = d = new Drawing_Area(20, 80, 410, 430);
  52.       o->box(FL_DOWN_BOX);
  53.       o->color(0);
  54.       o->selection_color(47);
  55.       o->user_data((void*)(this));
  56.       Fl_Group::current()->resizable(o);
  57.     }
  58.     { Fl_Input* o = x_input = new Fl_Input(30, 15, 125, 30, "x:");
  59.       o->type(1);
  60.       o->box(FL_THIN_DOWN_BOX);
  61.       o->color(8);
  62.       o->selection_color(7);
  63.       o->labelfont(11);
  64.       o->labelsize(20);
  65.       o->textfont(11);
  66.       o->textsize(20);
  67.       o->callback((Fl_Callback*)cb_x_input);
  68.       o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);
  69.     }
  70.     { Fl_Input* o = y_input = new Fl_Input(175, 15, 125, 30, "y:");
  71.       o->type(1);
  72.       o->box(FL_THIN_DOWN_BOX);
  73.       o->color(8);
  74.       o->selection_color(7);
  75.       o->labelfont(11);
  76.       o->labelsize(20);
  77.       o->textfont(11);
  78.       o->textsize(20);
  79.       o->callback((Fl_Callback*)cb_y_input);
  80.       o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);
  81.     }
  82.     { Fl_Input* o = w_input = new Fl_Input(325, 15, 105, 30, "w:");
  83.       o->type(1);
  84.       o->box(FL_THIN_DOWN_BOX);
  85.       o->color(8);
  86.       o->selection_color(7);
  87.       o->labelfont(11);
  88.       o->labelsize(20);
  89.       o->textfont(11);
  90.       o->textsize(20);
  91.       o->callback((Fl_Callback*)cb_w_input);
  92.       o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);
  93.     }
  94.     { Fl_Slider* o = new Fl_Slider(80, 50, 160, 15, "brightness:");
  95.       o->type(1);
  96.       o->box(FL_THIN_DOWN_BOX);
  97.       o->labelsize(10);
  98.       o->step(1);
  99.       o->slider_size(0.1);
  100.       o->callback((Fl_Callback*)cb_brightness);
  101.       o->align(FL_ALIGN_LEFT);
  102.       o->bounds(0,d->MAX_BRIGHTNESS);
  103.       o->value(d->DEFAULT_BRIGHTNESS);
  104.       o->slider(FL_UP_BOX);
  105.     }
  106.     { Fl_Box* o = new Fl_Box(240, 50, 190, 30, "left: click = zoom out, drag = zoom in\nright click: Julia set");
  107.       o->labelsize(10);
  108.       o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
  109.       o->deactivate();
  110.     }
  111.     { Fl_Slider* o = new Fl_Slider(80, 65, 160, 15, "iterations:");
  112.       o->type(1);
  113.       o->box(FL_THIN_DOWN_BOX);
  114.       o->labelsize(10);
  115.       o->step(1);
  116.       o->slider_size(0.1);
  117.       o->callback((Fl_Callback*)cb_iterations);
  118.       o->align(FL_ALIGN_LEFT);
  119.       o->bounds(1,d->MAX_ITERATIONS);
  120.       o->value(d->DEFAULT_ITERATIONS);
  121.       o->slider(FL_UP_BOX);
  122.     }
  123.     o->size_range(220,220);
  124.     o->end();
  125.   }
  126. }
  127.